package com.xx.jicheng.entity;

import java.io.Serializable;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@SuppressWarnings("serial")
public class Account implements Serializable {

	private int id;
	
	@NotNull(message="账号不能为空")
	@Size(max=16, min=3, message="账号长度必须在3~16个字符之间")
	private String accountNo;
	
	@NotNull(message="密码不能为空")
	@Size(max=18, min=6, message="密码长度必须在6~18个字符之间")
	private transient String password;
	
	@NotNull(message="手机不能为空")
	@Size(max=16, min=11, message="手机长度必须在11~16个字符之间")
	private String cellphone;
	
	@NotNull(message="账户类型不能为空")
	@Pattern(regexp="^(企业用户|个人用户)$", message="账号类型只能是【企业用户】或【个人用户】")
	private String accountType;
	
	private transient String salt;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getAccountNo() {
		return accountNo;
	}

	public void setAccountNo(String accountNo) {
		this.accountNo = accountNo;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getCellphone() {
		return cellphone;
	}

	public void setCellphone(String cellphone) {
		this.cellphone = cellphone;
	}

	public String getAccountType() {
		return accountType;
	}

	public void setAccountType(String accountType) {
		this.accountType = accountType;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	@Override
	public String toString() {
		return "Account [id=" + id + ", accountNo=" + accountNo + ", password=" + password + ", cellphone=" + cellphone
				+ ", accountType=" + accountType + "]";
	}

}
